import Vue from 'vue'
// import Vuex from './kvuex'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    count: 1
  },
  mutations: {
    add(state, num){
      state.count = state.count + num;
    }
  },
  actions: {
    add({commit}, payload){
      setTimeout(() => {
        commit("add", payload)
      }, 1000)
    }
  },
  modules: {
  }
})
